package net.qiqb.usr.points.application;

import lombok.Getter;
import net.qiqb.usr.custom.client.types.CustomerId;
import net.qiqb.usr.points.domain.Points;
import net.qiqbframework.modelling.command.Cmd;
import net.qiqbframework.modelling.command.FetchHandler;
import net.qiqbframework.modelling.domain.AggregateContext;
import net.qiqbframework.modelling.domain.FetchSource;

/**
 * 计算积分等级命令
 */
@Getter
//@Cmd(Points.class)
public class AppendPointsCmd {


    private final String id;

    public AppendPointsCmd(String id) {
        this.id = id;
    }


    @FetchHandler
    public Points fetch() {
        AggregateContext.updateFetchSource(FetchSource.LOAD.getValue());
        return new Points(id, new CustomerId("124"));
    }
}
